package com.purchasing.system.service;

import java.time.LocalDateTime;
import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import com.purchasing.system.model.Notification;

public interface NotificationService {
    Notification sendNotification(Long userId, String title, String content, Notification.NotificationType type, Long referenceId);
    
    void sendNotificationToAdmins(String title, String content, Notification.NotificationType type, Long referenceId);
    
    Page<Notification> getUserNotifications(Long userId, Pageable pageable);//表示返回的是一个分页结果，其中每条记录是一个 Notification 对象。


    Page<Notification> getUserNotificationsWithFilters(
            Long userId, 
            String type, 
            Boolean read, 
            LocalDateTime startDate, 
            LocalDateTime endDate, 
            Pageable pageable);//分页查询指定用户的通知，并支持多种筛选条件
    
    List<Notification> getUnreadNotifications(Long userId);
    
    long countUnreadNotifications(Long userId);
    
    Notification markNotificationAsRead(Long notificationId, Long userId);
    
    void markAllNotificationsAsRead(Long userId);
} 